package com.ruoyi.project.system.domain;

import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.MbEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 律所团队对象 sys_dept
 *
 * @author ruoyi
 * @date 2020-05-29
 */
@Data
@TableName("sys_dept")
@ApiModel(value="sys_dept对象", description="律所团队")
public class SysDept extends MbEntity {

    @TableId(value = "dept_id", type = IdType.AUTO)
    @ApiModelProperty(value = "部门id")
    private Long deptId;

    @Excel(name = "父部门id")
    @TableField("parent_id")
    @ApiModelProperty(value = "父部门id")
    private Long parentId;

    @Excel(name = "祖级列表")
    @TableField("ancestors")
    @ApiModelProperty(value = "祖级列表")
    private String ancestors;

    @Excel(name = "部门名称")
    @TableField("dept_name")
    @ApiModelProperty(value = "部门名称")
    @NotBlank(message = "部门名称不能为空")
    @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
    private String deptName;

    @Excel(name = "显示顺序")
    @TableField("order_num")
    @ApiModelProperty(value = "显示顺序")
    @NotBlank(message = "显示顺序不能为空")
    private Integer orderNum;

    @Excel(name = "负责人")
    @TableField("leader")
    @ApiModelProperty(value = "负责人")
    private String leader;

    @Excel(name = "联系电话")
    @TableField("phone")
    @ApiModelProperty(value = "联系电话")
    @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
    private String phone;

    @Excel(name = "邮箱")
    @TableField("email")
    @ApiModelProperty(value = "邮箱")
    @Email(message = "邮箱格式不正确")
    @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
    private String email;

    @Excel(name = "部门状态", readConverterExp = "0=正常,1=停用")
    @TableField("status")
    @ApiModelProperty(value = "部门状态（0正常 1停用）")
    private String status;

    @TableField("del_flag")
    @ApiModelProperty(value = "删除标志（0代表存在 2代表删除）")
    private String delFlag;

    @TableField("create_by")
    @ApiModelProperty(value = "创建者")
    private String createBy;

    @TableField("create_time")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @TableField("update_by")
    @ApiModelProperty(value = "更新者")
    private String updateBy;

    @TableField("update_time")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @Excel(name = "执业时间", width = 30, dateFormat = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") //格式化前台日期入参注解
    @TableField("practice_time")
    @ApiModelProperty(value = "执业时间")
    private Date practiceTime;

    @Excel(name = "业务专长")
    @TableField("expertise")
    @ApiModelProperty(value = "业务专长")
    private String expertise;

    @Excel(name = "工作区域")
    @TableField("region")
    @ApiModelProperty(value = "工作区域")
    private String region;

    @Excel(name = "工作区域")
    @TableField("address")
    @ApiModelProperty(value = "详细地址")
    private String address;

    @Excel(name = "工作区域")
    @TableField("district_code")
    @ApiModelProperty(value = "行政区号（逗号分割）")
    private String districtCode;

    @Excel(name = "到期时间", width = 30, dateFormat = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") //格式化前台日期入参注解
    @TableField("expire_time")
    @ApiModelProperty(value = "到期时间")
    private Date expireTime;

    @Excel(name = "团队限制人数")
    @TableField("limit_size")
    @ApiModelProperty(value = "团队限制人数")
    private Long limitSize;

    @Excel(name = "资质文件", readConverterExp = "冒=号分隔")
    @TableField("qualifications_file")
    @ApiModelProperty(value = "资质文件（冒号分隔）")
    private String qualificationsFile;

    /** 父部门名称 */
    @TableField(exist = false)
    private String parentName;

    /** 用户名 */
    @TableField(exist = false)
    private String userName;

    /** 密码 */
    @TableField(exist = false)
    private String password;

    /** 子部门 */
    @TableField(exist = false)
    private List<SysDept> children = new ArrayList<>();

    /** 资质文件图片集合 */
    @TableField(exist = false)
    private List imgs = new ArrayList<>();

}
